package kaufman.id.projects;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.Stroke;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;

import javax.swing.JPanel;

public class AnimationJPanel extends JPanel {

	public AnimationJPanel(int width, int height) {

	}

	public void paint(Graphics g) {
		super.paint(g);
		Graphics2D g2 = (Graphics2D) g;
		drawCoolStuff(g2);
		Font font = new Font("Serif", Font.ROMAN_BASELINE, 24);
		g2.setFont(font);
		g2.drawString("How Germany Sees the World", 40, 250);
	}

	private void drawStuff(Graphics2D g2d) { // learn to draw stuff
		// rectangle
		Rectangle rect = new Rectangle(10, 10, 100, 100);
		g2d.setColor(Color.green);
		g2d.fill(rect);

		// line
		Line2D.Double line = new Line2D.Double(0, 0, 500, 500);
		g2d.setColor(Color.red);
		Stroke s = new BasicStroke(20);
		g2d.setStroke(s);
		g2d.drawLine(0, 0, 500, 500);

		// circle
		Ellipse2D.Double circle = new Ellipse2D.Double(250, 250, 100, 100);

		g2d.setColor(Color.black);
		g2d.fill(circle);
	}

	private void drawCoolStuff(Graphics2D g2d) {
		Ellipse2D.Double circle = new Ellipse2D.Double(25, 0, 200, 200);

		g2d.setColor(Color.blue);
		g2d.fill(circle);

		Rectangle rect = new Rectangle(50, 50, 150, 30);
		g2d.setColor(Color.black);
		g2d.fill(rect);

		Rectangle rect2 = new Rectangle(50, 80, 150, 30);
		g2d.setColor(Color.red);
		g2d.fill(rect2);

		Rectangle rect3 = new Rectangle(50, 110, 150, 30);
		g2d.setColor(Color.yellow);
		g2d.fill(rect3);

	}
}
